package pe.gob.sedapal.scmultimedia.config;


import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContext{
	public static org.springframework.context.ApplicationContext ctx;
	private static final Logger logger = Logger.getLogger(ApplicationContext.class);
	
	public ApplicationContext() {
		super();
		
		//ctx = new AnnotationConfigApplicationContext(SpringJavaConfigStyle.class);	
		try{
			ctx = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		}catch(Exception e){
			e.printStackTrace();
			logger.error(e.getMessage(), e);
		}
	}	
	
	//@SuppressWarnings("rawtypes")
	public static <T> T getBean(Class<T> clase){		
		return ctx.getBean(clase);		
	}
}
